package springframework.PaymentDemo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class PaymentService {
    @Autowired
    private PaymentProcessor paymentProcessor;

    public void processPayment(double amount) {
        // 这里省去了其它的与支付相关的逻辑
        //...
        
        // 调用支付处理器处理支付
        paymentProcessor.processPayment(amount);

        // 这里省去了其它的与支付相关的逻辑
        //...
    }
}
